#ifndef PKGLIST_H
#define PKGLIST_H

class PackageDescription;

class PackageList
{
	public:
		PackageList();
		~PackageList();
		
		bool8 load();
		bool8 save(bool8 forceSave = false);

		PackageDescription* getItem(int32 index);	// zero-based

		void addItem(PackageDescription*);
		bool8 removeItem(PackageDescription*);		// doesn't delete it

		int32 getCount();

	private:
		int32 strip(TCHAR*, int32);

	protected:
		PackageDescription	*head, *tail;
		int32				count;
		bool8				changed;
};

inline
PackageList::PackageList()
{
	head = tail = (PackageDescription*)0;
	count = 0;
	changed = false;
}

inline int32
PackageList::getCount()
{
	return count;
}

#endif
